using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using bitzhuwei.Compiler;

namespace bitzhuwei.AnsiCFormat {
    /// <summary>
    /// Correspond to the Vn node primary_expression in the grammar(AnsiC).
    /// </summary>
    internal abstract partial class Vnprimary_expression : IFullFormatter {
        // [000]=primary_expression : 'identifier' ;
        // [001]=primary_expression : 'constant' ;
        // [002]=primary_expression : 'string_literal' ;
        // [003]=primary_expression : '(' expression ')' ;

        private readonly TokenRange _scope;
        public TokenRange Scope => _scope;

        public void Format(TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

        public void FullFormat(BlankConfig preConfig, TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

        public IEnumerable<string> YieldTokens(TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

        internal class token_ : Vnprimary_expression {
            // [000]=primary_expression : 'identifier' ;
            // [001]=primary_expression : 'constant' ;
            // [002]=primary_expression : 'string_literal' ;

            public readonly Token token0;
            public token_(Token r0) {
                this.token0 = r0;
            }
        }
        internal class expression_ : Vnprimary_expression {
            // [003]=primary_expression : '(' expression ')' ;

            public readonly Token token2;
            public readonly Vnexpression exp;
            public readonly Token token0;
            public expression_(Token r2, Vnexpression r1, Token r0) {
                this.token2 = r2;
                this.exp = r1;
                this.token0 = r0;
            }
        }
    }
}
